<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="步骤3：手动配置环境变量">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001792343590.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001792343582">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>步骤3：手动配置环境变量</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="ZH-CN_TOPIC_0000001792343582"></a><a name="ZH-CN_TOPIC_0000001792343582"></a>
  <h1 class="topictitle1">步骤3：手动配置环境变量</h1>
  <div>
   <p>MySQL/MariaDB在执行备份任务前，需要将MySQL/MariaDB注册为系统服务，并在所有节点手动配置mysqlbinlog、mysqldump、mysqld和mysql环境变量。</p>
   <div class="section">
    <h4 class="sectiontitle">操作步骤</h4>
    <ol>
     <li><span>登录MySQL/MariaDB实例所在的主机。</span></li>
     <li><span>执行<strong>systemctl status mysqld</strong>或<strong>service mysqld status</strong>命令，查看MySQL/MariaDB实例运行状态。</span><p></p>
      <ul>
       <li>如果有运行状态回显，则表示MySQL/MariaDB已注册为系统服务，请继续执行<a href="#ZH-CN_TOPIC_0000001792343582__li9580114917475">4</a>。</li>
       <li>如果无运行状态回显，则表示MySQL/MariaDB需要注册为系统服务。
        <ol type="a">
         <li>在MySQL/MariaDB的安装目录下找到mysql.server。</li>
         <li>执行<strong>cp </strong><em>安装目录</em><strong>/mysql.server</strong><strong><em> </em>/etc/init.d/mysql</strong>命令，注册系统服务。</li>
        </ol></li>
      </ul> <p></p></li>
     <li><span>依次执行以下命令设置环境变量。</span><p></p><p><strong>ln -sf /</strong><em>安装目录</em><strong>/bin/mysqlbinlog /usr/bin/</strong></p> <p><strong>ln -sf /</strong><em>安装目录</em><strong>/bin/mysql /usr/bin/</strong></p> <p><strong>ln -sf /</strong><em>安装目录</em><strong>/bin/mysqldump /usr/bin/</strong></p> <p><strong>ln -sf /</strong><em>安装目录</em><strong>/bin/mysqld /usr/bin/</strong></p> <p></p></li>
     <li id="ZH-CN_TOPIC_0000001792343582__li9580114917475"><a name="ZH-CN_TOPIC_0000001792343582__li9580114917475"></a><a name="li9580114917475"></a><span>分别执行<strong>mysqlbinlog --version、</strong><strong>mysqldump --version</strong>、<strong>mysqld --version</strong>和<strong>mysql --version</strong>命令，查看是否已设置环境变量，如果有版本号回显，则表示已设置环境变量成功。</span></li>
    </ol>
   </div>
   <p></p>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="zh-cn_topic_0000001792343590.html">备份MySQL/MariaDB数据库</a>
    </div>
   </div>
  </div>
 </body>
</html>